/*
 * File: Analyser.java 
 *  
 * Created on 26.09.2009
 */
package de.graph.mapper.impl;

import de.graph.common.Graph;
import de.graph.common.Vertex;
import de.graph.mapper.GraphMapper;

public abstract class GraphMapperImpl implements GraphMapper
{
    protected GraphMapperImpl()
    {
    }
    
    protected Vertex copyVertex(Graph newGraph, Vertex oldVertex) {

        Vertex newVertex = newGraph.createVertex();
        for (String propertyKey : oldVertex.getPropertyKeys()) {
            Object propertyValue = oldVertex.getProperty(propertyKey);

            if (propertyKey.equals("inEdges") || propertyKey.equals("outEdges")) {
                continue;
            }
            
            newVertex.setProperty(propertyKey, propertyValue);
        }

        return newVertex;
    }
}
